import Router from "koa-router";
import axios from "axios";
import { fileList, fileDetail } from "./urlConfig";

const router = Router();

// 视频
// 视频列表
router.get("/video/list", async (ctx, next) => {
  let response = await axios.post(fileList);
  ctx.body = response.data;
});

router.get("/video/detail", async (ctx, next) => {
  var id = ctx.query.id;
  console.log("id", id);
  let response = await axios.post(
    fileDetail,
    JSON.stringify({
      id,
    }),
    {
      headers: {
        "Content-Type": "application/json",
      },
    }
  );
  ctx.body = response.data;
});

export default router;
